package com.wisdytech.linkdcs.system.action;


import com.wisdytech.common.bean.StandardResult;
import com.wisdytech.linkdcs.system.model.SysDict;
import com.wisdytech.linkdcs.system.service.ISystemDictService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/system/dict")
public class SystemDictAction {

    @Resource
    ISystemDictService systemDictService;

    @ResponseBody
    @RequestMapping("/getSysDictsByParentKey/get.mvc")
    public StandardResult getSysDictsByParentKey(String parentKey) {
        List<SysDict> list = systemDictService.listSysDictsByParentKey(parentKey);
        return StandardResult.getSuccessResult(list);
    }
    
    @ResponseBody
    @RequestMapping("/getMalfunctionTypeByDictValue/get.mvc")
    public StandardResult getMalfunctionTypeByDictValue(String search) {
        List<SysDict> list = systemDictService.getMalfunctionTypeByDictValue(search);
        return StandardResult.getSuccessResult(list);
    }
}
